<?php

	header("Content-Type: text/html;charset=utf-8");

	include("function/_nosql.php"); //
	include("function/function.php");

	include("_include.user.judge.php");
	
	$orderid = chkstr(trim($_REQUEST['orderid']));//订单编号
	$aid = getClassName("kboy_order","aid","id = '$orderid'");
	$allnum = getNewsNums("kboy_active_score","newsid = '$aid'");
	$shis = getNewsNums("kboy_active_score","score_text  = '10' and newsid = '$aid'");
	$bas = getNewsNums("kboy_active_score","score_text  = '8' and newsid = '$aid'");
	$lius = getNewsNums("kboy_active_score","score_text  = '6' and newsid = '$aid'");
	$sis = getNewsNums("kboy_active_score","score_text  = '4' and newsid = '$aid'");
	$ers = getNewsNums("kboy_active_score","score_text  = '2' and newsid = '$aid'");
	$shi = round($shis/$allnum,3)*100;
	$ba = round($bas/$allnum,3)*100;
	$liu = round($lius/$allnum,3)*100;
	$si = round($sis/$allnum,3)*100;
	$er = round($ers/$allnum,3)*100;
	if(!is_numeric($orderid)){
	  echo erro("参数错误！");
	}
	if(getNewsNums("kboy_order","uid=".$_SESSION['kboy_userid']." and id=$orderid") <1){
	  echo erro("参数错误");
	}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>会员中心</title>

<link rel="stylesheet" href="css/common.css"/>

<link rel="stylesheet" href="css/sq.css"/>

<link rel="stylesheet" href="css/activity.css"/>
<script type="text/javascript" src="js/baidutongji.js"></script>
<script type="text/javascript" src="js/laydate/laydate.js"></script>

</head>

<body>

    <!--top-bar begin-->

	<? include("_include.top.topbar.php") ?>

    <!--top-bar end-->

    <!--banner begin-->

    <? include("_include.user.topbar.php")?>

    <!--banner end-->

    <!--member center-->

    <div class="member-box">

        <div class="content">

			<? include("_include.user.leftnav.php") ?>

            <div class="member-box-r">

                <div class="member-item1">

                    <div class="m-title">线路评价</div>

                    <?php include_once('_include.user.ordersearch.php');?>

                </div>

                <div class="member-basic">

				<!----线路评价 开始--->

                  <div class="mdd-item"  style="margin-left:15px;">

						<div class="mdd-item-con">

							<div class="score-raty-wrap">

							  	<input type="hidden" id="ratyValue" />
								<input type="hidden" name="orderid" id="orderid" value="<?php echo $orderid;?>" />

								<div class="score-raty-box">

									<div class="score-raty-c">

										<div class="score-raty-l" data-scrore="1">

											<img src="images/star-off.png" alt="">

											<img src="images/star-off.png" alt="">

											<img src="images/star-off.png" alt="">

											<img src="images/star-off.png" alt="">

											<img src="images/star-off.png" alt="">

										</div>

										<div class="score-raty-l">

											<span class="score">0.0</span>

										</div>

										<div class="score-raty-l">

											<span class="small">(<i><?=getNewsNums("kboy_active_score","newsid='$aid'");?></i>人评分)</span>

										</div>

									</div>

									<ul class="score-raty-detail">

										<li>

											<div class="score-raty-l">

												<img src="images/star-on.png" alt="">

												<img src="images/star-on.png" alt="">

												<img src="images/star-on.png" alt="">

												<img src="images/star-on.png" alt="">

												<img src="images/star-on.png" alt="">

											</div>

											<div class="score-raty-l">

												<div class="score-raty-progress">

													<div class="score-raty-progress-in" style="width:<?php echo $shi; ?>%;"></div>

												</div>

												<div class="score-raty-desc"><span><?php echo $shi; ?>%</span>（吐血推荐）</div>

											</div>

										</li>

										<li>

											<div class="score-raty-l">

												<img src="images/star-on.png" alt="">

												<img src="images/star-on.png" alt="">

												<img src="images/star-on.png" alt="">

												<img src="images/star-on.png" alt="">

												<img src="images/star-off.png" alt="">

											</div>

											<div class="score-raty-l">

												<div class="score-raty-progress">

													<div class="score-raty-progress-in" style="width:<?php echo $ba; ?>%;"></div>

												</div>

												<div class="score-raty-desc"><span><?php echo $ba; ?>%</span>（重点推荐）</div>

											</div>

										</li>

										<li>

											<div class="score-raty-l">

												<img src="images/star-on.png" alt="">

												<img src="images/star-on.png" alt="">

												<img src="images/star-on.png" alt="">

												<img src="images/star-off.png" alt="">

												<img src="images/star-off.png" alt="">

											</div>

											<div class="score-raty-l">

												<div class="score-raty-progress">

													<div class="score-raty-progress-in" style="width:<?php echo $liu; ?>%;"></div>

												</div>

												<div class="score-raty-desc"><span><?php echo $liu; ?>%</span>（一般推荐）</div>

											</div>

										</li>

										<li>

											<div class="score-raty-l">

												<img src="images/star-on.png" alt="">

												<img src="images/star-on.png" alt="">

												<img src="images/star-off.png" alt="">

												<img src="images/star-off.png" alt="">

												<img src="images/star-off.png" alt="">

											</div>

											<div class="score-raty-l">

												<div class="score-raty-progress">

													<div class="score-raty-progress-in" style="width:<?php echo $si; ?>%;"></div>

												</div>

												<div class="score-raty-desc"><span><?php echo $si; ?>%</span>（最好别去）</div>

											</div>

										</li>

										<li>

											<div class="score-raty-l">

												<img src="images/star-on.png" alt="">

												<img src="images/star-off.png" alt="">

												<img src="images/star-off.png" alt="">

												<img src="images/star-off.png" alt="">

												<img src="images/star-off.png" alt="">

											</div>

											<div class="score-raty-l">

												<div class="score-raty-progress">

													<div class="score-raty-progress-in" style="width:<?php echo $er; ?>%;"></div>

												</div>

												<div class="score-raty-desc"><span><?php echo $er; ?>%</span>（千万别去）</div>

											</div>

										</li>

									</ul>

								</div>

								<div class="score-raty-post">

									<div class="raty-post"><a href="#" class="addping">提交评分</a></div>

									<div class="raty-tips">只有参加过活动的人才可以点评，并且点评是匿名的。</div>

								</div>

							</div>

							<div class="line-impress-wrap">

								<div class="line-title">线路印象</div>

								<div class="line-impress-box">

									<div class="impress-label">

										<!--<span class="l-color1">萨菲哈sd卡</span>

										<span class="l-color2">所发生的发生</span>

										<span class="l-color3">是非得失开发</span>

										<span class="l-color4">离开看了</span>-->

									</div>

									<input type="hidden" id="spanValue" value=""/>

									<div class="line-impress-add">

										<input type="text" class="impress-text"/>

										<div class="impress-post"><a href="#" class="addping">添加印象</a></div>

									</div>

								</div>

							</div>

						</div>

					</div>

				 </div>

				 <!--- 线路评价 结束--->

            </div>

        </div>

    </div>

    <!--member center-->

    <!--foot begin-->

	<? include("_include.bottom.footbar.php") ?>

    <!--foot begin-->

    <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>

    <script type="text/javascript" src="js/jquery.SuperSlide.2.1.1.js"></script>

    <script type="text/javascript" src="js/main.js"></script>

    <script type="text/javascript" src="js/sq.js"></script>
	<script type="text/javascript" src="layer/layer.js"></script>

    <script type="text/javascript" src="js/jquery.cityselect.js"></script>

	  <script type="text/javascript" src="js/activity.js"></script>

    <script type="text/javascript">

        jQuery(".project-case").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"left",vis:3,trigger:"click",pnLoop:false});

        jQuery(".team-list").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"left",vis:7,trigger:"click",pnLoop:false});

        jQuery(".single-con-r").slide({titCell:".hd ul",mainCell:".bd .ulWrap",effect:"left",vis:1,pnLoop:false});

        jQuery(".sign-list").slide({titCell:".hd ul",mainCell:".bd .ulWrap",effect:"left",vis:2,pnLoop:false});

        jQuery(".hd-xc").slide({titCell:".hd ul",mainCell:".bd ul",effect:"leftLoop",autoPage:true,vis:3,trigger:"click"});
		
	$(document).on('click', '.addping', function(event) {
		event.preventDefault();
		var ratyValue = $("#ratyValue").val();
		var spanValue = $("#spanValue").val();
		var orderid =$("#orderid").val();
		if(ratyValue=='' && spanValue==''){ alert('请选择评分数或添加印象');return false;}
		var url='user_orderaddping.php?action=addping';
		$.ajax({
			url: url,
			data:{ratyValue:ratyValue,spanValue:spanValue,orderid:orderid},
			type: 'get',
			dataType: 'html'
		})
			.done(function(data) {
				// 返回草稿箱内容的html代码
				if(data==1){
				layer.msg('操作成功');
				}
				else{
				layer.msg('操作失败');
				}
			})
			.fail(function() {
				layer.msg('操作失败');
			})
	})
    </script>
</body>

</html>



